package net.minglemangle.android;

import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.AnalogClock;
import android.widget.ImageView;
import android.widget.RelativeLayout;

public class CustomAnalogClock extends AnalogClock {
	private RelativeLayout mRelativeLayout;
	private Drawable mDrawableSecondHand;
	private ImageView mViewHandSecond;	
	
	public CustomAnalogClock(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		this.CommonWork(context);
	}

	public CustomAnalogClock(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.CommonWork(context);
	}

	public CustomAnalogClock(Context context) {
		super(context);
		this.CommonWork(context);
	}

	public void CommonWork(Context context) {
		this.mDrawableSecondHand = context.getResources().getDrawable(R.drawable.widgetsecond);
		this.mViewHandSecond = new ImageView(context);
		this.mViewHandSecond.setImageDrawable(this.mDrawableSecondHand);

		this.mRelativeLayout.addView(mViewHandSecond);
		/*
		RotateAnimation animation = new RotateAnimation(15, 15);
		
		if(this.mViewHandSecond == null) {
			Log.i("Exception", "1");
		} else if(animation == null) {
			Log.i("Exception", "2");
		} else {
			this.mViewHandSecond.setAnimation(animation);
		}
		 */
	}
}